#define _CRT_SECURE_NO_WARNINGS 1
#include"vector.h"
using namespace myvector;
void testmyvector1()
{
	vector<int> v;
	v.reserve(10);
	cout << v.size() << endl;
	cout<<v.capacity()<<endl;
	v.push_back(1);
	v.push_back(2);
	v.push_back(3);
	v.push_back(4);
	v.push_back(5);
	v.push_back(6);
	//cout << v.size() << endl;
	//cout << v.capacity() << endl;
	v[1] = 10;
	v[2] = 20;
	v[3] = 30;
	//cout << v.size() << endl;
	//cout << v.capacity() << endl;
	//v.pop_back();
	//v.pop_back();
	//v.pop_back();
	//v.pop_back();
	//v.pop_back();
	//v.pop_back();
	//v.pop_back();

}
void testmyvector2()
{
	vector<int>v;
	//int i = 5;
	//v.reserve(10);
	//v.push_back(1);
	//v.push_back(2);
	//v.push_back(3);
	//v.push_back(4);
	//v.push_back(5);
	//v.push_back(6);
	v.resize(5);
	v.insert(v.begin(), 100);
	v.insert(v.end(), 200);
	v.erase(v.begin() + 1);
	v.erase(v.begin() + 2);
	v.resize(2);


}

void testmyvector3()
{
	vector<int> v(15, 10);
	//for (auto ch : v)
	//{
	//	cout << ch << endl;
	//}
	vector<int> v2(v);
	for (auto ch : v2)
	{
		cout << ch << endl;
	}
	cout << endl;
	vector<int> v3;
	vector<int> v4;
	v3= v4=v2;
	for (auto &ch : v3)
	{
		cout << ch << endl;
	}
	cout << endl;
	for (auto &ch : v4)
	{
		cout << ch << endl;
	}
	cout << endl;
}
void testmyvector4()
{
	std::string s("fghjkl");
	vector<std::string>v(3,s);
	for (auto& ch : v)
	{
		cout << ch << endl;
	}
	cout << endl;
	int sum[10] = { 1,2,3,4,5,6,7,8,9,0 };
	vector<int>v2(sum, sum + 10);
	for (auto& ch : v2)
	{
		cout << ch << endl;
	}
	cout << endl;
	std::string s2("0123456789");
	vector<std::string>v3(v.begin(),v.end());
	for (auto ch : v3)
	{
		cout << ch << endl;
	}
	cout << endl;
}
void testmyvector5()
{
	vector<std::string>v;
	v.resize(10, "rftgyhujioloikjuhygbvfcvmunhgbfvdcsx");
	v.push_back("123456");
	v.push_back("1234567");
	v.push_back("12345678");
	v.push_back("123456789");
	v.push_back("1234567890");
	v.push_back("123456789011");
	for (auto ch : v)
	{
		cout << ch << endl;
	}
	cout << endl;
}

int main()
{
	testmyvector5();


	return 0;
}